﻿#region Using

using System;

#endregion

namespace Vk.Exceptions
{
    public class ApiRequestErrorException : Exception
    {
        private readonly ApiError _error;

        public ApiRequestErrorException(ApiError error) : base(error.Description)
        {
            _error = error;
        }

        public ApiRequestErrorException()
        {
        }

        public ApiRequestErrorException(string message)
            : base(message)
        {
        }

        public ApiRequestErrorException(string message, Exception inner)
            : base(message, inner)
        {
        }

        public override string ToString()
        {
            return string.Format("Error code: {0}, Message: {1}", _error.Code, _error.Description);
        }
    }
}